import axios from './config'

export async function findAllMyTasks (sort) {
  return axios.get('/book/epubee/task', {
    params: {
      sort
    }
  })
}

export async function deleteMyTasks (ids) {
  return axios.delete('/book/epubee/task', {
    params: {
      ids
    }
  })
}

export async function searchBook (query) {
  return axios.get('/book/search', {
    params: query
  })
}

export async function searchLocalBook (query) {
  return axios.get('/book/search/local', {
    params: query
  })
}

export async function addTask (task) {
  return axios.post('/book/epubee/task', task)
}

export async function bookDetails (id) {
  return axios.get('/book/details', {
    params: {
      id
    }
  })
}

export async function addThirdPartyUri (data) {
  return axios.post('/book/thirdPartyUri', data)
}

export async function addBook (book) {
  return axios.post('/book', book)
}
